INCLUDE_DIRECTORIES (../)
INCLUDE_DIRECTORIES (./)

ADD_EXECUTABLE(
        EWADesktop

        Main.cpp

        EWADesktopDockerSpace.hpp
        EWADesktopDockerSpace.cpp

        EWADesktopTimeline.hpp
        EWADesktopTimeline.cpp
)

TARGET_LINK_LIBRARIES (EWADesktop EWAUITimeline)
TARGET_LINK_LIBRARIES (EWADesktop EWAUIWidget)
TARGET_LINK_LIBRARIES (EWADesktop EWAUI)
TARGET_LINK_LIBRARIES (EWADesktop EWAPrj)

TARGET_LINK_LIBRARIES (EWADesktop EyerMath)
TARGET_LINK_LIBRARIES (EWADesktop EyerCore)
TARGET_LINK_LIBRARIES (EWADesktop EyerThread)
TARGET_LINK_LIBRARIES (EWADesktop EyerGLAD)

TARGET_LINK_LIBRARIES (EWADesktop gtest)
TARGET_LINK_LIBRARIES (EWADesktop imgui)
TARGET_LINK_LIBRARIES (EWADesktop glfw3)

TARGET_LINK_LIBRARIES (EWADesktop avformat)
TARGET_LINK_LIBRARIES (EWADesktop avcodec)
TARGET_LINK_LIBRARIES (EWADesktop swscale)
TARGET_LINK_LIBRARIES (EWADesktop swresample)
TARGET_LINK_LIBRARIES (EWADesktop avutil)

TARGET_LINK_LIBRARIES (EWADesktop freetype)
TARGET_LINK_LIBRARIES (EWADesktop x264)
TARGET_LINK_LIBRARIES (EWADesktop png)
TARGET_LINK_LIBRARIES (EWADesktop z)
TARGET_LINK_LIBRARIES (EWADesktop bz2)
TARGET_LINK_LIBRARIES (EWADesktop lzma)
TARGET_LINK_LIBRARIES (EWADesktop mp3lame)
TARGET_LINK_LIBRARIES (EWADesktop jsoncpp)
TARGET_LINK_LIBRARIES (EWADesktop dl)

IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
    MESSAGE(STATUS "current platform: Linux ")
    TARGET_LINK_LIBRARIES (EWADesktop X11)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
    MESSAGE(STATUS "current platform: Windows")
    ADD_DEFINITIONS(-D EYER_PLATFORM_WINDOWS)
    TARGET_LINK_LIBRARIES (EWADesktop ws2_32)
    TARGET_LINK_LIBRARIES (EWADesktop Secur32)
    TARGET_LINK_LIBRARIES (EWADesktop imm32)
    TARGET_LINK_LIBRARIES (EWADesktop Mfplat)
    TARGET_LINK_LIBRARIES (EWADesktop Bcrypt)
    TARGET_LINK_LIBRARIES (EWADesktop Strmiids)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android")
    MESSAGE(STATUS "current platform: Android")
    ADD_DEFINITIONS(-D EYER_PLATFORM_ANDROID)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
    MESSAGE(STATUS "current platform: Darwin")
    ADD_DEFINITIONS(-D EYER_PLATFORM_DARWIN)
    TARGET_LINK_LIBRARIES (EWADesktop iconv)
ELSE ()
    MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

INSTALL(
        TARGETS EWADesktop
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
)

FILE(COPY
        ${CMAKE_CURRENT_SOURCE_DIR}/HarmonyOS_Sans_SC_Light.ttf
        DESTINATION
        ${CMAKE_CURRENT_BINARY_DIR}/
        )
